<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>51youtu - editor</title>

<link rel="stylesheet" href="res/basic.css">
<link rel="stylesheet" href="res/common_util.css">
<link rel="stylesheet" href="res/header2.css">
<link rel="stylesheet" href="res/footer.css">

<link rel="stylesheet" href="./jquery/masonry/style.masonry.css" />
<link href="./jquery/lightbox/lightbox.css" rel="stylesheet" />

<!-- ueditor css -->
<link rel="stylesheet" href="ueditor/themes/default/ueditor.css"> 

<style type="text/css">
</style>

<!-- js -->
<script src="./jquery/jquery-1.7.2.min.js"></script>
<script src="./jquery/masonry/jquery.masonry.min.js"></script>
<script src="./jquery/lightbox/lightbox.js"></script>

<!-- ueditor js -->
<script type="text/javascript" src="ueditor/editor_config.js"></script>
<script type="text/javascript" src="ueditor/editor_all.js"></script>

<script>

	QueryString = {
		data : {},
		Initial : function() {
			var aPairs, aTmp;
			var queryString = new String(window.location.search);
			queryString = queryString.substr(1, queryString.length); //remove   "?"   
			aPairs = queryString.split("&");
			for ( var i = 0; i < aPairs.length; i++) {
				aTmp = aPairs[i].split("=");
				this.data[aTmp[0]] = aTmp[1];
			}
		},
		GetValue : function(key) {
			return this.data[key];
		}
	}

	//on load document
	$(function() {
		QueryString.Initial();
		var itemId=QueryString.GetValue('itemId'); 


		//alert("editor")

		//
		var editor = new baidu.editor.ui.Editor();
		editor.render("myEditor");

		//先要构造编辑器然后 再用jquery填内容
		if(typeof(itemId)=='string'){
			$.getJSON("./item!getItemById.act"+"?"+"itemId="+itemId, function(data) {
				
				$('#itemContent').html(data.item.text);
				//editor.setContent(data.item.text);
				$('#myEditor').html(data.item.text);
			})
		}
	});
</script>

<div id="header2">
	<!-- -->
	<div id="brand">
		<div class="section-wrap">
			<div class="logo">
				<h1>
					<a href="#" title="51youtu"></a>
				</h1>
			</div>

			<ul class="action"></ul>
		</div>
	</div>
	
	<div id="nav">
		<div class="section-wrap">

			<ul class="entries clearfix">

				<li class="first"><a
					href="#">首页</a></li>

				<li class="split"></li>
				<li class="multi-nav">

					<div class="nav-trigger">
						<a href="javascript:void(0);">随便看看</a> <span class="icon"></span>
					</div>

					<div class="more-nav">
						<ul class="topic clearfix">

							<li><a
								href="#">最热</a><span
								class="hot"> </span>
							</li>
							<li><a
								href="#">最新</a>
							</li>

						</ul>
						<ul class="category clearfix">

							<li><a
								href="#">服饰</a>
							</li>
							<li><a
								href="#">家居</a>
							</li>
							<li><a
								href="#">创意DIY</a>
							</li>
							<li><a
								href="#">美容</a>
							</li>
							<li><a
								href="#">亲子</a>
							</li>
							<li><a
								href="#">美女帅哥</a>
							</li>
							<li><a
								href="#">美食</a>
							</li>
							<li><a
								href="#">摄影</a>
							</li>
							<li><a
								href="#">旅行</a>
							</li>
							<li><a
								href="#">宠物</a>
							</li>
							<li><a
								href="#">搞笑趣味</a>
							</li>
							<li><a
								href="#">明星</a>
							</li>
							<li><a
								href="#">婚恋</a>
							</li>
							<li><a
								href="#">数码</a>
							</li>
							<li><a
								href="#">大杂烩</a>
							</li>

						</ul>
					</div></li>
				<li class="split"></li>

				<li><a
					href="#">活动汇</a>
				</li>

				<li class="split"></li>

				<li><a
					href="#">看图购</a>
				</li>
			</ul>

			<div class="search-bar">

				<form id="pix-search-form" class="search clearfix"
					action="#" method="get">
					<input id="pix-search-input" name="q" placeholder="搜图片 / 图集 / 找人"
						maxlength="30" type="text">
					<button type="submit"></button>
				</form>
				
			</div>
		</div>
	</div>
</div>

</head>
<body>

<div id="itemContent">

</div>

<form action="./c/item!addItem.act" method="post">
<script type="text/plain" id="myEditor" name="text">
   	old 内容
	<p>
	</p>
	<br/>zhongwen
</script>
<input name="submit" value="提交" type="submit">
</form>

<script type="text/javascript">
 //  var editor = new baidu.editor.ui.Editor();
 //  editor.render("myEditor");
</script> 
</body>
<footer>
<div id="footer"> 
<div id="footer_stripe">
</div>
<div id="copyright">
沪ICP备12041334号 Copyright © 2012 wfeng007 <br/> 
wfeng007@163.com <br/>
</div> 
</footer>

</html>